<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        li {
            list-style: none;
        }
    </style>
</head>

<body>
    <ul>
        <li class="first"><input type="checkbox" name="" id="">全选</li>
        <li><input type="checkbox" name="" id="a">高</li>
        <li><input type="checkbox" name="" id="a">富</li>
        <li><input type="checkbox" name="" id="a">帅</li>
        <li><input type="checkbox" name="" id="a">年轻</li>
    </ul>
    <script>
        var first = document.getElementsByClassName('first');
        var others = document.querySelectorAll('#a');
        first.onclick = function () {
            console.log(this.checked);
            for (var i = 0; i < others.length; i++) {
                others[i].checked = this.checked;
            }
        }

    </script>
</body>

</html>